#include "class-timer.h"

/***
 * cTimer Member Functions
 **/

cTimer::cTimer(){

	fpsTarget = 60;

	currentTime = SDL_GetTicks();
	targetTime  = SDL_GetTicks();
}

bool cTimer::update(){

	msPerFrame = 1000/fpsTarget;

	currentTime = SDL_GetTicks();

	if (currentTime > targetTime){

		targetTime = (Uint32)(currentTime + msPerFrame);

		return true;
	}

	return false;
}